package demo;

import java.util.Map;
import java.util.stream.Collectors;

public class stream7 {
    public static void main(String[] args) {
        YesOrNo("ppRYYGrrYBR2258","YrR8RrY");
    }
    public static void YesOrNo(String s1,String s2){
        Map<Character,Long> map1 = s1.chars().mapToObj(c -> (char)c)
                .collect(Collectors.groupingBy(c -> c,Collectors.counting()));
        Map<Character,Long> map2 = s2.chars().mapToObj(c -> (char)c)
                .collect(Collectors.groupingBy(c -> c,Collectors.counting()));

        boolean allMatch = map2.entrySet().stream()
                        .allMatch(e -> map1.getOrDefault(e.getKey(),0L) >= e.getValue());
        if(allMatch){
            System.out.println("Yes:"+(s1.length() - s2.length()));
        } else {
            System.out.println("No");
        }
    }
}
